<!doctype html>
<html lang="zh-CN">
<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <title>强化学习迷宫演示</title>
  <style>
    :root {
      --bg-grad-start: #0f172a;
      --bg-grad-end: #1e293b;
      --card-bg: #0b1220cc;
      --text: #e5e7eb;
      --muted: #94a3b8;
      --accent: #38bdf8;
      --accent-2: #8b5cf6;
    }
    html, body { height: 100%; }
    body {
      margin: 0; color: var(--text); font-family: system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
      background: radial-gradient(1200px 600px at 20% -10%, var(--bg-grad-end), var(--bg-grad-start));
    }
    .container { max-width: 1080px; margin: 0 auto; padding: 24px; }
    header { margin: 24px 0 16px; }
    header h1 { font-size: 28px; margin: 0 0 8px; letter-spacing: 0.5px; }
    header p { margin: 0; color: var(--muted); }
    .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
    .card { background: var(--card-bg); border: 1px solid #1f2937; border-radius: 14px; padding: 16px 16px 18px; box-shadow: 0 8px 24px rgba(0,0,0,0.25); }
    .card h2 { margin: 0 0 8px; font-size: 20px; }
    .card p { margin: 0 0 12px; color: var(--muted); }
    .badge { display: inline-block; font-size: 12px; color: white; background: linear-gradient(135deg, var(--accent), var(--accent-2)); padding: 4px 10px; border-radius: 999px; }
    img, video { max-width: 100%; height: auto; border-radius: 10px; border: 1px solid #273244; }
    .actions { margin-top: 12px; display: flex; gap: 12px; }
    .btn { display: inline-block; padding: 8px 12px; border-radius: 10px; border: 1px solid #374151; color: var(--text); text-decoration: none; }
    .btn:hover { border-color: #4b5563; }
    footer { margin: 24px 0; color: var(--muted); }
    @media (max-width: 860px) { .grid { grid-template-columns: 1fr; } }
  </style>
</head>
<body>
  <div class="container">
    <header>
      <span class="badge">Gymnasium + SB3 (PPO) / Q-learning 回退</span>
      <h1>强化学习迷宫演示</h1>
      <p>运行 <code>python main.py --train-steps 8000 --maze-size 10 --obstacle-density 0.18 --render-gif</code> 生成 <code>artifacts</code> 后刷新本页查看。</p>
    </header>

    <section class="grid">
      <div class="card">
        <h2>训练奖励曲线</h2>
        <p>文件：<code>artifacts/training_curve.png</code></p>
        <img src="../artifacts/training_curve.png" alt="training curve" />
        <div class="actions">
          <a class="btn" href="../artifacts/training_curve.png" download>下载曲线 PNG</a>
        </div>
      </div>
      <div class="card">
        <h2>迷宫演示 GIF / MP4</h2>
        <p>文件：<code>artifacts/demo.gif</code>、<code>artifacts/demo.mp4</code></p>
        <img src="../artifacts/demo.gif" alt="demo gif" />
        <video src="../artifacts/demo.mp4" controls style="margin-top:12px"></video>
        <div class="actions">
          <a class="btn" href="../artifacts/demo.gif" download>下载 GIF</a>
          <a class="btn" href="../artifacts/demo.mp4" download>下载 MP4</a>
        </div>
      </div>
    </section>

    <footer>
      <p>提示：训练期间控制台会打印进度（epsilon、平均奖励、步数百分比等）。</p>
      <p>静态部署：将本项目上传至 Gitee Pages 或任意静态服务器，确保 <code>artifacts</code> 可访问。</p>
    </footer>
  </div>
</body>
</html>